define(function () {

    var WebcastCheckBtnGroup=function (config){
  		var group=this;
  		config=config || {};
  		group.changeCallback=config.changeCallback || function(){};
  		group.$dom=$('<span></span>');
  		group.recordBtn=new CheckBtn({
  			inputName:'webcastRecord',
  			labelText:i18next.t('table.recordlesson'),//'录课 '
  		});
  		group.liveBtn=new CheckBtn({
  			inputName:'webcastLive',
  			disabled:true,
  			labelText:i18next.t('table.live'),//'直播 '
  		});
  		group.replayBtn=new CheckBtn({
  			inputName:'webcastReplay',
  			disabled:true,
  			labelText:i18next.t('table.playback'),//'回放 '
  		});
  		group.$dom.append(group.recordBtn.$dom,'&nbsp;&nbsp;',group.liveBtn.$dom,'&nbsp;&nbsp;',group.replayBtn.$dom)
  		group.checkRecord=function(){
  			var recordOpen=group.recordBtn.checked();
  			if(recordOpen){
  				group.liveBtn.disabled(false);
  				group.replayBtn.disabled(false);
  			}else{
  				group.liveBtn.checked(false);
  				group.liveBtn.disabled(true);

  				group.replayBtn.checked(false);
  				group.replayBtn.disabled(true);
  			}
  		}
  		group.value=function(newValue){
  			if(newValue===undefined){
  				return [
  					group.recordBtn.checked(),
  					group.liveBtn.checked(),
  					group.replayBtn.checked()
  				]
  			}else{
  				group.recordBtn.checked(newValue[0]);
  				group.liveBtn.checked(newValue[1]);
  				group.replayBtn.checked(newValue[2]);
  				return true;
  			}
  		}
  		group.recordBtn.$input.on('change',function(){
  			group.checkRecord();
  			group.changeCallback(group.value());

  		});
  		group.liveBtn.$input.on('change',function(){
  			group.changeCallback(group.value());
  		});
  		group.replayBtn.$input.on('change',function(){
  			group.changeCallback(group.value());
  		});
  	}

    window.WebcastCheckBtnGroup = WebcastCheckBtnGroup;
    return WebcastCheckBtnGroup;
})
